#version 450

layout(location = 0) in vec3 in_position;
layout(location = 1) in vec2 in_texcoord;
layout(location = 2) in vec3 in_normal;

out gl_PerVertex
{
    vec4 gl_Position;
};

layout(set = 0, binding = 0, std140) uniform FrameUBO
{
    mat4 projMatrix;
    mat4 viewMatrix;
    ivec2 resolution;
    uint frameId;
    float time;
} frameUBO;

layout(push_constant) uniform PushConstants
{
    mat4 modelMatrix;
    mat3 normalMatrix;
} pushConstants;

out layout(location = 1) vec2 out_texcoord;

void main()
{
    gl_Position = frameUBO.projMatrix * frameUBO.viewMatrix * pushConstants.modelMatrix * vec4(in_position, 1.f);
    out_texcoord = in_texcoord;
}